package br.ufes.inf.lprm.cwtools.tools;

import java.io.File;

public class IOUtils {
	static public boolean deleteDirectory(File path) {
		if(path.exists()){
			File[] files = path.listFiles();
			for(File subFile: files){
				if(subFile.isDirectory()) {
					if(!deleteDirectory(subFile)){
						return false;
					}
				}else{
					if(!subFile.delete()){
						return false;
					}
				}
			}
		}
		return(path.delete());
	}
}